
const router = require('koa-router'); // 引入路由
const {verify_auth ,verifyPermission,verifyLogin} =require('../middleware/auth')  // 引入鉴权   鉴权中间件
const {reply,createComment,deleteComment,updateComment} = require('../controllers/comment') // 引入控制器
const commentRouter = new router({
  prefix: '/comment'
});
commentRouter.post('/',verify_auth,verifyPermission,createComment)
// 回复评论
commentRouter.post('/:commentId/reply',verify_auth,verifyPermission,reply)
// 修改评论
commentRouter.patch('/:commentId',verify_auth,verifyPermission,updateComment)
// 删除评论
commentRouter.delete('/:commentId',verify_auth,verifyPermission,deleteComment)
module.exports = commentRouter;